package co.droidforum.foodx.application.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class FoodXDB extends SQLiteOpenHelper{
	
	/**
	 * Nombre de la base de datos del sistema de foodx
	 */
	private static final String DATABASE = "FoodXDB.db";
	/**
	 * Creacion tabla tokens
	 */
	private static final String sqlCreateTableTokens = "CREATE TABLE tokens (_id INTEGER PRIMARY KEY AUTOINCREMENT, token TEXT)";
	
	
	public FoodXDB(Context context){
		super(context, DATABASE, null, 1);//cambio version a 2 con la nueva tabla
	}
	
	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(sqlCreateTableTokens);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		onCreate(db);
	}
}